package com.forum.controller;

import com.forum.jspmine.common.reposresult.Result;
import com.forum.jspmine.common.reposresult.StatusCode;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author:jayChou
 * @date:2019/7/19 description:神来之手
 * 动态获取菜单
 */
@ControllerAdvice
public class BaseExceptionHandel {


    @ResponseBody
    @ExceptionHandler(Exception.class)
    public Result exception(Exception e){
        e.printStackTrace();

        return new Result(StatusCode.ERROR,false,e.getMessage());


    }


}
